﻿using Entity.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity.Mapping
{
    public class BancoMap : EntityTypeConfiguration<Banco>
    {
        public BancoMap()
        {
            // Chave Primaria
            this.HasKey(t => t.Id);

            // Propriedades
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.Descricao)
                .HasMaxLength(80);

            // Mapeamento Tabela Coluna
            this.ToTable("Banco", "Sgf");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.CodBanco).HasColumnName("CodBanco");
            this.Property(t => t.Descricao).HasColumnName("Descricao");
        }
    }
}
